]> dgit.raspbian.org Git - ostree.git/commitdiff
ci: Add Rust validate targets to Justfile for local development
authorXiaofeng Wang <henrywangxf@me.com>
Tue, 31 Mar 2026 07:15:30 +0000 (15:15 +0800)
committerXiaofeng Wang <henrywangxf@me.com>
Tue, 31 Mar 2026 07:15:30 +0000 (15:15 +0800)
Add just targets mirroring the CI Rust checks so developers can run
them locally before pushing:
- validate: runs both fmt and clippy checks
- cargo-fmt-check: checks formatting across all crates
- cargo-clippy: runs clippy with the same lint config as CI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
Justfile

index 8f96a7dc385d57255ebffb93af49a7a5763c72cb..64840429f4db0ec6d10a213840448cf6f25ab8b1 100644 (file)
--- a/Justfile
+++ b/Justfile
@@ -133,3 +133,20 @@ clang-format:
 # Check source files against clang-format defaults
 clang-format-check:
     {{sourcefiles}} | xargs clang-format -i --Werror --dry-run
+
+clippy_config := "-A clippy::all -D clippy::correctness -D clippy::suspicious -Dunused_imports -Ddead_code"
+
+# Run all Rust lint and format checks (mirrors CI)
+validate:
+    just cargo-fmt-check
+    just cargo-clippy
+
+# Check Rust formatting across all crates
+cargo-fmt-check:
+    cargo fmt -p ostree -- --check -l
+    for d in tests/inst tests/bootc-integration tests/xtask; do cargo fmt --manifest-path $d/Cargo.toml -- --check -l; done
+
+# Run cargo clippy across all crates
+cargo-clippy:
+    cargo clippy -p ostree --features=v2022_6 -- {{clippy_config}}
+    for d in tests/inst tests/bootc-integration tests/xtask; do cargo clippy --manifest-path $d/Cargo.toml -- {{clippy_config}}; done